import Vue from 'vue';
import Router from 'vue-router';
import Home from '../pages/Home/Home.vue';
import Login from '../pages/Login/Login.vue';
import ProjectListMap from '../pages/ProjectListMap/ProjectListMap.vue';
import ProjectMap from '../pages/ProjectMap/ProjectMap.vue';
import Mine from '../pages/Mine/Mine.vue';
import ProjectList from '../pages/ProjectList/ProjectList.vue';

const Proeject = () => import('../pages/Project/Project.vue');
const FamilyList = () => import('../pages/FamilyList/FamilyList.vue');
const Collect = () => import('../pages/Collect/Collect.vue');
const NoFound = () => import('../pages/404.vue');
const SignDetail = () => import('../pages/SignDetail/SignDetail.vue');
const GetMoneyDetail = () => import('../pages/GetMoneyDetail/GetMoneyDetail.vue');
const SignProjectDetail = () => import('../pages/SignProjectDetail/SignProjectDetail.vue');
const GetProjectMoneyDetail = () => import('../pages/GetProjectMoneyDetail/GetProjectMoneyDetail.vue');
const PayMoneyDetail = () => import('../pages/PayDetail/PayDetail.vue');
const PayProejctMoneyDetail = () => import('../pages/PayProjectDetail/PayProjectDetail.vue');


Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      meta: {
        showFooter: true,
        index: 0,
      },
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
      meta: {
        showFooter: false,
        index: 0,
        disCheck: true
      },
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      meta: {
        showFooter: true,
        index: 0
      },
    },
    {
      path: '/projectList',
      name: 'projectList',
      component: ProjectList,
      meta: {
        showFooter: true,
        index: 0
      },
    },
    {
      path: '/project',
      name: 'project',
      component: Proeject,
      meta: {
        showFooter: false,
        index: 1
      },
    },
    {
      path: '/projectListMap',
      name: 'projectListMap',
      component: ProjectListMap,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      path: '/projectMap',
      name: 'projectMap',
      component: ProjectMap,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      path: '/familyList',
      name: 'familyList',
      component: FamilyList,
      meta: {
        showFooter: false,
        index: 2,
      }
    },
    {
      path: '/collect',
      name: 'collect',
      component: Collect,
      meta: {
        showFooter: false,
        index: 2,
      }
    },
    {
      path: '/mine',
      name: 'mine',
      component: Mine,
      meta: {
        showFooter: true,
        index: 0
      },
    },
    {
      path: '/signDetail',
      name: 'signDetail',
      component: SignDetail,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      path: '/signProjectDetail',
      name: 'signProjectDetail',
      component: SignProjectDetail,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      path: '/getMoneyDetail',
      name: 'getMoneyDetail',
      component: GetMoneyDetail,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      path: '/getProjectMoneyDetail',
      name: 'getProjectMoneyDetail',
      component: GetProjectMoneyDetail,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      path: '/payMoneyDetail',
      name: 'payMoneyDetail',
      component: PayMoneyDetail,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      path: '/payProejctMoneyDetail',
      name: 'payProejctMoneyDetail',
      component: PayProejctMoneyDetail,
      meta: {
        showFooter: false,
        index: 3
      },
    },
    {
      name: '404',
      path: '/404',
      component: NoFound,
      meta: {
        showFooter: false,
        index: 1
      },
    },
    {
      path: '*',    // 此处需特别注意至于最底部
      redirect: '/404'
    }
  ],
});
